<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<meta charset="utf-8" />
		<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
		<meta name="renderer" content="webkit">
		<meta name="viewport" content="width=device-width, initial-scale=1.0">
		<title>找回密码</title>
		<meta http-equiv="X-UA-Compatible" content="IE=edge">
		<link rel="stylesheet" href="/home/plugs/swiper/dist/css/swiper.css">
		<link rel="stylesheet" href="/home/css/comment.css" />
		<link rel="stylesheet" href="/home/css/register.css" />
		<script src="/admin/js/jquery.min.js"></script>
		<script src="/common/layer/layer.js" type="text/javascript"></script>
		<script src="/admin/js/admin.js"></script>
		<style type="text/css">
			html,
			body {
				height: 100%;
			}

			html {
				display: table;
				margin: auto;
			}

			body {
				display: table-cell;
				vertical-align: middle;
				background-color: #2196F3 !important;
			}

			.blue {
				background-color: #2196F3 !important;
			}

			.margin {
				margin: 0 !important;
			}
		</style>
	</head>
	<body class="blue">
		<div class="join_table" style="z-index: 999;opacity: 0.9;">
			<div class="register-title">找回密码:</div>
			<form role="form" id="login" action="<?=url('passport/findpwd')?>" method="post">
				<table width="100%" cellpadding="0" cellspacing="0" border="0">
					<tbody>
						<tr>
							<td class="controls">
								<input type="text" class="text_01 b_r3" id="mobile" data-rule-required="true" data-rule-mobile="true" name="mobile"
								 placeholder="请输入手机号">
							</td>
						</tr>
						<tr>
							<td class="controls">
								<input type="password" class="text_01 b_r3" id="password" data-rule-required="true" data-rule-yzpassword="true"
								 name="password" placeholder="请输入密码">
							</td>
						</tr>
						<tr>
							<td class="controls">
								<input type="password" class="text_01 b_r3" data-rule-required="true" equalto="#password" name="password2"
								 placeholder="请确认密码">
							</td>
						</tr>
						<tr>
							<td class="controls">
								<a class="s_btn b_r3 bg_base fr jq_get_code" id="captcha" href="<?=url('passport/sendSms')?>" type="button"
								 onclick="get_yzm(this)">获取短信验证码</a>
								<div class="yzm">
									<input type="text" class="text_01 b_r3" name="code" id="phone" placeholder="请输入短信验证码">
								</div>
							</td>
						</tr>
						<tr>
							<td>
								<input mini="submit" type="submit" class="s_btn tj_btn bg_orange b_r24 jq_reg" name="submit" value="立即找回">
							</td>
						</tr>
					</tbody>
				</table>
			</form>
		</div>
		</div>
	</body>
</html>
<script>
	var time_djs = 180;
	//获取验证码
	$(document).on('click', "#captcha", function(e) {
		if (time_djs !== 180) {
			return false;
		}
		var miniAct = $(this);
		var href = $(this).attr('href');
		var data = {
			mobile: $("#mobile").val(),
			countryCode: $("#countryCode").val()
		};
		e.preventDefault();
		layer.closeAll(); //关闭所有的窗口
		if (miniAct.attr('lock') != 1) {
			miniAct.attr('lock', 1);
			var load = layer.load(1);
			$.get(href, data, function(data) {
				miniAct.attr('lock', 0);
				layer.close(load); //关闭所有的窗口
				if (data.data !== 200) {
					layer.msg(data.msg);

				} else {
					var t_obj = $("#captcha");
					t_obj.attr("disabled", "disabled");
					t_obj.text(time_djs + "s");
					var my_set = setInterval(function() {
						if (time_djs > 0) {
							time_djs--;
							t_obj.text(time_djs + "s");
						} else {
							t_obj.attr("disabled", "false");
							t_obj.text('重新获取');
							clearInterval(my_set);
							time_djs = 180;
						}
					}, 1000);
				}

			}, 'json');
		}
	});
</script>
